package com.example.tranhtheuchuthap;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;



public class Tuy_Chon extends Activity  {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tuychon);
		Button btn_GuiAnh=(Button)findViewById(R.id.btnGuiAnhLenSV);
		Button btn_GuiThamSo=(Button)findViewById(R.id.btnGuiThamSoHC);
		Button btn_TraBangMau=(Button)findViewById(R.id.btnTraCuuBangMauDMC);
		Button btn_LuuAnh=(Button)findViewById(R.id.btnLuuAnh);
		Button btn_XemLog=(Button)findViewById(R.id.btnXemFileLog);
		Button btn_QuayLai=(Button)findViewById(R.id.btnQuaylai);
		btn_GuiAnh.setOnClickListener(onClickListener);
        btn_GuiThamSo.setOnClickListener(onClickListener);
        btn_TraBangMau.setOnClickListener(onClickListener);
        btn_LuuAnh.setOnClickListener(onClickListener);
        btn_XemLog.setOnClickListener(onClickListener);
        btn_QuayLai.setOnClickListener(onClickListener);
        
}

private OnClickListener onClickListener = new OnClickListener() {
	int key=0;
     @Override
     public void onClick(final View v) {
         switch(v.getId()){
             case R.id.btnGuiAnhLenSV:
                 key =1; 
             break;
             case R.id.btnGuiThamSoHC:
                  key=2;
             break;
             case R.id.btnTraCuuBangMauDMC:
                 key=3;
            break;
             case R.id.btnLuuAnh:
                 key=4;
            break;
             case R.id.btnXemFileLog:
                 key=5;
            break;
             case R.id.btnQuaylai:
                 
            break;
            
         }
Intent i=new Intent();
i.putExtra("key", key);
setResult(RESULT_OK, i);
finish();
   }
};
		
	}

